
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpMapColor.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpMapColorForm"
 */
public class CcpMapColorForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cmcGuid = null;
   private java.lang.String _cmeGuid = null;
   private java.lang.String _cmcName = null;
   private java.lang.String _cmcColor = null;
   private java.math.BigDecimal _lowLimit = null;
   private java.math.BigDecimal _upLimit = null;
   private java.lang.String _cmcOrder = null;
   private java.lang.String _reserved1 = null;
   private java.lang.String _reserved2 = null;
   private java.lang.String _reserved3 = null;

   /**
    * Standard constructor.
    */
   public CcpMapColorForm() {
   }

   /**
    * Returns the cmcGuid
    *
    * @return the cmcGuid
    */
   public java.lang.String getCmcGuid() {
      return _cmcGuid;
   }

   /**
    * Sets the cmcGuid
    *
    * @param cmcGuid the new cmcGuid value
    */
   public void setCmcGuid(java.lang.String cmcGuid) {
      _cmcGuid = cmcGuid;
   }
   /**
    * Returns the cmeGuid
    *
    * @return the cmeGuid
    */
   public java.lang.String getCmeGuid() {
      return _cmeGuid;
   }

   /**
    * Sets the cmeGuid
    *
    * @param cmeGuid the new cmeGuid value
    */
   public void setCmeGuid(java.lang.String cmeGuid) {
      _cmeGuid = cmeGuid;
   }
   /**
    * Returns the cmcName
    *
    * @return the cmcName
    */
   public java.lang.String getCmcName() {
      return _cmcName;
   }

   /**
    * Sets the cmcName
    *
    * @param cmcName the new cmcName value
    */
   public void setCmcName(java.lang.String cmcName) {
      _cmcName = cmcName;
   }
   /**
    * Returns the cmcColor
    *
    * @return the cmcColor
    */
   public java.lang.String getCmcColor() {
      return _cmcColor;
   }

   /**
    * Sets the cmcColor
    *
    * @param cmcColor the new cmcColor value
    */
   public void setCmcColor(java.lang.String cmcColor) {
      _cmcColor = cmcColor;
   }
   /**
    * Returns the lowLimit
    *
    * @return the lowLimit
    */
   public java.math.BigDecimal getLowLimit() {
      return _lowLimit;
   }

   /**
    * Sets the lowLimit
    *
    * @param lowLimit the new lowLimit value
    */
   public void setLowLimit(java.math.BigDecimal lowLimit) {
      _lowLimit = lowLimit;
   }
   /**
    * Returns the upLimit
    *
    * @return the upLimit
    */
   public java.math.BigDecimal getUpLimit() {
      return _upLimit;
   }

   /**
    * Sets the upLimit
    *
    * @param upLimit the new upLimit value
    */
   public void setUpLimit(java.math.BigDecimal upLimit) {
      _upLimit = upLimit;
   }
   /**
    * Returns the cmcOrder
    *
    * @return the cmcOrder
    */
   public java.lang.String getCmcOrder() {
      return _cmcOrder;
   }

   /**
    * Sets the cmcOrder
    *
    * @param cmcOrder the new cmcOrder value
    */
   public void setCmcOrder(java.lang.String cmcOrder) {
      _cmcOrder = cmcOrder;
   }
   /**
    * Returns the reserved1
    *
    * @return the reserved1
    */
   public java.lang.String getReserved1() {
      return _reserved1;
   }

   /**
    * Sets the reserved1
    *
    * @param reserved1 the new reserved1 value
    */
   public void setReserved1(java.lang.String reserved1) {
      _reserved1 = reserved1;
   }
   /**
    * Returns the reserved2
    *
    * @return the reserved2
    */
   public java.lang.String getReserved2() {
      return _reserved2;
   }

   /**
    * Sets the reserved2
    *
    * @param reserved2 the new reserved2 value
    */
   public void setReserved2(java.lang.String reserved2) {
      _reserved2 = reserved2;
   }
   /**
    * Returns the reserved3
    *
    * @return the reserved3
    */
   public java.lang.String getReserved3() {
      return _reserved3;
   }

   /**
    * Sets the reserved3
    *
    * @param reserved3 the new reserved3 value
    */
   public void setReserved3(java.lang.String reserved3) {
      _reserved3 = reserved3;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCmcGuid() == null) {
         errors.add("cmcGuid", new ActionError("error.cmcGuid.required"));
      }
      // TODO test format/data
      return errors;
   }
}
